﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="ctlSurfaceListBrowser.ascx.cs" Inherits="Ctl_ctlSurfaceListBrowser" %>
<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="cc1" %>
<%@ Register src="ctlQ_State.ascx" tagname="ctlQ_State" tagprefix="uc1" %>
<table width ="100%" cellspacing ="0" cellpadding  ="3px"  >    
    <asp:ListView ID="lvSides" runat="server" onitemcommand="lvSides_ItemCommand" 
        onitemediting="lvSides_ItemEditing" onitemupdating="lvSides_ItemUpdating" >
         <LayoutTemplate>                        
            <tr ID="Tr1" runat="server" >                            
                <td     class ="grd_td_head"  >                
                    <table style ="width :100%" cellpadding ="3px" cellspacing ="5px" >
                        <tr >
                            <td style="width :17px">
                                &nbsp
                            </td>
                            <td style ="width:17px"  >                                                               
                                &nbsp
                            </td>
                            <td style ="width:100px"  >
                                GID
                            </td>                            
                            <td>
                                Тип носителя
                            </td>
                            <td style ="width :300px">
                                Адрес
                            </td>
                            <td style ="width :80px">
                                Цена
                            </td>
                            
                            <td style ="width :80px">
                                Начало
                            </td>
                            <td style ="width :80px">
                                Окончание
                            </td>
                            <td style ="width :80px">                            
                                Сумма
                            </td>
                        </tr>
                    </table>
                                    
                </td>
            </tr>
            <tr ID="itemPlaceholder" runat="server">
            </tr>
        </LayoutTemplate>        
         <ItemTemplate>          
            <tr ID="Tr1" runat="server" >                            
                <td     class ="grd_td_item" onmouseout="GrdItemOnMouseOut(this);" onmouseover="GrdItemOnMouseOver(this);" >                
                    <table style ="width :100%" cellpadding ="3px" cellspacing ="5px" >
                        <tr >    
                            <td style ="width:17px"  >                     
                                <asp:ImageButton ID=ImageButton1 runat="server" CommandName ="Edit" ImageUrl ="~/images/grd_plus.gif" />
                            </td>                        
                            <td style ="width:17px"  >                                                               
                                <asp:ImageButton ID="btnShowQ" ImageUrl ="~/images/Q.PNG" OnClick ="ShowQ_Click" CommandArgument =<%# Eval("ID") %> Visible =<%#  Eval("In_Q") %>  runat="server" />
                            </td>
                            <td style ="width:100px"  >
                                <%# Eval("GID")     %>                           
                                <%#  Eval("Litera") %>
                            </td>                            
                            <td>
                                <%#  Eval("ConstractionType")%>
                            </td>
                            <td style ="width :300px">
                                <%#  Eval("FullAdress")%>
                            </td>
                            <td style ="width :80px">
                                <%#  ((int)Eval("ConractPrice")).ToString()%>
                            </td>
                            
                            <td style ="width :80px">
                                <%# ((DateTime)Eval("DtStart")).ToString("d")%>
                            </td>
                            <td style ="width :80px">
                                <%# ((DateTime)Eval("DtFinish")).ToString("d")%>
                            </td>
                            <td style ="width :80px">                            
                                <%# ((Int32)Eval("Summa")).ToString()%>                                
                            </td>
                            <td style="width :17px">
                                <asp:ImageButton ID="btnDelete" runat="server"  CommandArgument =<%# Eval("ID") %>  OnClick ="btnDelete_Click" ImageUrl="~/images/trash.png" />
                                <cc1:ConfirmButtonExtender  ConfirmText ="Удалить запись?" TargetControlID ="btnDelete" ID="ConfirmButtonExtender1" runat="server">
                                </cc1:ConfirmButtonExtender>
                            </td>
                        </tr>
                    </table>
                                    
                </td>
                
            </tr>            
        </ItemTemplate>
        <EditItemTemplate >
        <tr>
            <td class ="EditRowBackGround" >
                <table width ="100%" cellpadding ="0" cellspacing ="3px"  >
                <%--Сторона--%>
                <tr>
                    <td style ="width:25%;font-weight:bold "   >Сторона:
                    <asp:HiddenField ID="hfId" Value =<%# Eval("ID").ToString()  %> runat ="server" />
                    </td>
                    <td >
                    <%#  Eval("Litera").ToString ()  +"  "+ Eval("GID").ToString ()%>     
                    
                        
                    </td>
                </tr>
                <%--Носитель--%>
                <tr> 
                    
                    <td style ="width:25%;font-weight:bold" >Носитель:</td>
                    <td ><%#  Eval("ConstractionType")%></td>
                </tr>
                <tr> 
                    
                    <td class="grd_td_item"  style ="width:25%;font-weight:bold" >Адрес:</td>
                    <td class="grd_td_item" ><%#  Eval("FullAdress")%></td>
                </tr>
                
             
                 <%--Цена--%>
                <tr>                 
                    
                    <td style ="width:25%;font-weight:bold"  >&nbsp</td>
                    <td >
                        <table width="100%" >
                            <tr >
                                <td style ="width:25%">
                                Начало:
                                </td>
                                <td style ="width:25%">
                                <asp:TextBox ID="txtStart" Text =<%# ((DateTime)Eval("DtStart")).ToString("d") %> CssClass ="TextBox" Width ="100px" runat="server"></asp:TextBox>
                                    <cc1:CalendarExtender ID="txtStart_CalendarExtender" Format="dd.MM.yyyy" runat="server" Enabled="True" TargetControlID="txtStart">
                                    </cc1:CalendarExtender>
                                    
                                </td>
                                <td style ="width:25%">Рекомендуемая цена <br /> (руб./сутки):</td>
                                <td style ="width:25%">
                                    <asp:LinkButton ID=LinkButton1 runat="server"><%# ((int)Eval("Price")).ToString() %> </asp:LinkButton>
                                      
                                 </td>
                            </tr>
                        </table>
                    </td>
                </tr>
               <%--Период--%>
                <tr>                 
                    
                    <td style ="width:25%;font-weight:bold"  >&nbsp</td>
                    <td >
                        <table width="100%" >
                            <tr >
                                <td style ="width:25%">Окончание:</td>
                                <td style ="width:25%">
                                    <asp:TextBox ID="txtEnd"  Text =<%# ((DateTime)Eval("DtFinish")).ToString("d") %> CssClass ="TextBox" Width ="100px" runat="server"></asp:TextBox>
                                    <cc1:CalendarExtender ID="txtEnd_CalendarExtender1" Format="dd.MM.yyyy" runat="server" Enabled="True" TargetControlID="txtEnd">
                                    </cc1:CalendarExtender>                                      
                                </td>
                                <td style ="width:25%">Цена контракта <br />(руб./сутки):</td>
                                <td style ="width:25%; vertical-align :middle " >
                                    <asp:TextBox ID="txtConractPrice" Text =<%# ((int)Eval("ConractPrice")).ToString() %> Width ="100px" CssClass ="TextBox" runat="server"></asp:TextBox>                                    
                                    <cc1:MaskedEditExtender ID="me_txtConractPrice"
                                    Mask="9999"
                                    runat="server"
                                    MessageValidatorTip="true" 
                                    OnFocusCssClass="MaskedEditFocus" 
                                    OnInvalidCssClass="MaskedEditError"
                                    MaskType="Number" 
                                    InputDirection="LeftToRight"  
                                    AcceptNegative="Left"                     
                                    ErrorTooltipEnabled="True"                     
                                     TargetControlID="txtConractPrice">                     
                                     </cc1:MaskedEditExtender>
                                      <cc1:MaskedEditValidator                 
                                        ControlExtender="me_txtConractPrice"
                                        ControlToValidate="txtConractPrice" 
                                        IsValidEmpty="true"  
                                        MaximumValue="9000" 
                                        EmptyValueMessage="Введите число"
                                        InvalidValueMessage="Неверное значение"
                                        MaximumValueMessage="Значение > 0"
                                        MinimumValueMessage="Значение < 9000"
                                        MinimumValue="1" 
                                        EmptyValueBlurredText="*" 
                                        InvalidValueBlurredMessage="*" 
                                        MaximumValueBlurredMessage="*" 
                                        MinimumValueBlurredText="*"
                                        Display="Dynamic" 
                                        TooltipMessage="Введите число: 1-9000"
                                        ID="mev_txtSurfCount" runat="server">
                                        </cc1:MaskedEditValidator>
                                 </td>
                            </tr>
                        </table>
                    </td>
                </tr>
                
                <%--Итог--%>
                <tr>                 
                    
                    <td style ="width:25%;font-weight:bold"  >&nbsp</td>
                    <td class="grd_td_item" >
                        <table width="100%" >
                            <tr >
                                <td style ="width:25%">Длительность(дней):</td>
                                <td style ="width:25%">
                                    <asp:Label ID=lblDayCount Font-Bold ="true" runat="server" ><%# ((Int32)Eval("DayLen")).ToString()%> </asp:Label>                                                                        
                                </td>
                                <td style ="width:25%">Сумма (руб.):</td>
                                    
                                <td >
                                    <asp:Label ID="lblSumma" Font-Bold ="true"   runat="server" ><%# ((Int32)Eval("Summa")).ToString()%></asp:Label>                                    
                                 </td>
                                     
                                <td style ="text-align :right"  >                                    
                                    <asp:CheckBox Text ="Вне очереди" ID="chqPrioritetLevel" Checked=<%# Eval("IsPrioritetLevel") %>  runat="server" />                                    
                                </td>
                                
                            </tr>
                        </table>
                    </td>
                </tr>
                
                
                
                  <tr>                 
                    
                    <td style ="width:25%"  class="grd_td_item">&nbsp</td>
                    <td style="text-align :right " class="grd_td_item">
                     <table style="width :100%">
                     <tr >
                        <td id="td_CrossPeriod"  style ="text-align :left;" >
                            <asp:Label ID="lblMessage" ForeColor = "#ff3300"  
                            CssClass = <%# GetMessageCSS(Container.DataItem) %>                                 
                            runat="server" >Внимание! Пересечение периодов - сохранить в очереди? </asp:Label>                                                                
                            <br />
                            <asp:LinkButton ID="lnkQ" runat="server" CssClass = <%# GetMessageCSS(Container.DataItem) %>>Очередь</asp:LinkButton>
                            
                            
                         </td>
                        <td style="width :100px">  
                                <asp:Button ID="btnSaveCommonInfo" Font-Bold ="true" Width="100px" runat ="server" CommandArgument =<%# Eval("ID").ToString() %> CommandName ="Update" CssClass ="btn_wizard" Text ="Сохранить"  />                                                       
                        </td>
                     </tr>
                     </table>
                     
                     
                        
                    </td>
                </tr>
                
                </table>
            </td>
        </tr>
        </EditItemTemplate>
</asp:ListView>       
</table>

 <cc1:ModalPopupExtender 
                    ID="ModalPopupext_QList" 
                    runat="server"
                    TargetControlID="Button4"
                    PopupControlID="Q_Panel"
                    PopupDragHandleControlID="Q_Panel"
                    BackgroundCssClass="modalBackground"
                    DropShadow="true"                                         
                    OkControlID="Button2"
                    CancelControlID="Button3"
                    X ="3" 
                    Y="30">
    </cc1:ModalPopupExtender>
  
    <asp:Panel ID="Q_Panel" runat="server" CssClass="modalPopup" Width="700px" Height ="400px" style="display:none">
    <asp:UpdatePanel ID ="updCaption"  runat ="server"  >
        <ContentTemplate >        
            <uc1:ctlQ_State ID="ctlQ_State1" runat="server" />                
        </ContentTemplate> 
        </asp:UpdatePanel> 
        
    </asp:Panel>

<asp:Button ID="Button2" runat="server" Text="Button" style="display:none" />
<asp:Button ID="Button3" runat="server" Text="Button" style="display:none"/>
<asp:Button ID="Button4" runat="server" Text="Button" style="display:none"/>


